<template>
    <div class="my_message" v-if="JSON.stringify(msgInfo) != '{}'">
        <div class="mesg_center">
            <div class="mesg_caten1">
                <!-- 物流消息 -->
                <div
                    class="mesg_items"
                    v-if="msgInfo.message_logistics && false"
                    @click="
                        $router.push({
                            path: '/messageList',
                            query: { type: 0 },
                        })
                    "
                >
                    <span class="mesg_img"
                        ><img src="../../assets/images/mesg-logistics.png" /><i
                            v-show="
                                msgInfo.no_read.message_logistics_no_read > 0
                            "
                            >{{ msgInfo.no_read.message_logistics_no_read }}</i
                        ></span
                    >
                    <span class="mesg_thumb">
                        <em
                            ><b>物流</b
                            ><i>{{
                                msgInfo.message_logistics.send_time_text
                            }}</i></em
                        >
                        <p>{{ msgInfo.message_logistics.message_title }}</p>
                    </span>
                </div>
                <div
                    class="mesg_items"
                    v-if="!msgInfo.message_logistics && false"
                    @click="
                        $router.push({
                            path: '/messageList',
                            query: { type: 0 },
                        })
                    "
                >
                    <span class="mesg_img"
                        ><img src="../../assets/images/mesg-logistics.png"
                    /></span>
                    <span class="mesg_thumb">
                        <em><b>物流</b><i></i></em>
                        <p>暂无消息</p>
                    </span>
                </div>

                <!-- 消息通知 -->
                <div
                    class="mesg_items"
                    v-if="msgInfo.message_notice"
                    @click="
                        $router.push({
                            path: '/messageList',
                            query: { type: 0 },
                        })
                    "
                >
                    <span class="mesg_img"
                        ><img src="../../assets/images/mesg-notes.png" /><i
                            v-show="msgInfo.no_read.message_notice_no_read > 0"
                            >{{ msgInfo.no_read.message_notice_no_read }}</i
                        ></span
                    >
                    <span class="mesg_thumb">
                        <em
                            ><b>通知</b
                            ><i>{{
                                msgInfo.message_notice.send_time_text
                            }}</i></em
                        >
                        <p>{{ msgInfo.message_notice.message_title }}</p>
                    </span>
                </div>
                <div
                    class="mesg_items"
                    v-if="!msgInfo.message_notice"
                    @click="
                        $router.push({
                            path: '/messageList',
                            query: { type: 0 },
                        })
                    "
                >
                    <span class="mesg_img"
                        ><img src="../../assets/images/mesg-notes.png" /></span>
                    <span class="mesg_thumb">
                        <em><b>通知</b><i></i></em>
                        <p>暂无消息</p>
                    </span>
                </div>

                <!-- 活动消息 -->
                <div
                    class="mesg_items"
                    v-if="msgInfo.message_activity"
                    @click="
                        $router.push({
                            path: '/messageList',
                            query: { type: 1 },
                        })
                    "
                >
                    <span class="mesg_img"
                        ><img src="../../assets/images/mesg-activi.png" /><i
                            v-show="
                                msgInfo.no_read.message_activity_no_read > 0
                            "
                            >{{ msgInfo.no_read.message_activity_no_read }}</i
                        ></span
                    >
                    <span class="mesg_thumb">
                        <em
                            ><b>活动</b
                            ><i>{{
                                msgInfo.message_activity.send_time_text
                            }}</i></em
                        >
                        <p>{{ msgInfo.message_activity.message_title }}</p>
                    </span>
                </div>
                <div
                    class="mesg_items"
                    v-if="!msgInfo.message_activity"
                    @click="
                        $router.push({
                            path: '/messageList',
                            query: { type: 1 },
                        })
                    "
                >
                    <span class="mesg_img"
                        ><img src="../../assets/images/mesg-activi.png" /></span>
                    <span class="mesg_thumb">
                        <em><b>活动</b><i></i></em>
                        <p>暂无消息</p>
                    </span>
                </div>
            </div>
            <hr class="bot_line" />
            <div class="mesg_caten2"></div>
        </div>
        <div class="zhanwei"></div>
    </div>
</template>

<script>
import { axiosPost } from '../../axios';
import { Toast } from 'vant';
export default {
    name: '',
    data() {
        return {
            msgInfo: {},
        };
    },
    computed: {},
    mounted() {
        this.getMsglist();
    },
    methods: {
        getMsglist() {
            axiosPost('/api/user/message_notice', {}, (res) => {
                // console.log(res);
                if (res.status != 1) {
                    return Toast({
                        message: res.msg,
                        duration: 2000,
                    });
                }
                this.msgInfo = res.data;
            });
        },
    },
};
</script>

<style lang="less" scope>
@import url('../../assets/css/mesg_center.css');
.my_message {
}
</style>
